-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix jetty completion handling to forward failures #6197
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thx!
...lient-jetty/src/main/java/io/fabric8/kubernetes/client/jetty/JettyAsyncResponseListener.java
Show resolved
Hide resolved
7883832
to
9f94ee6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to call attention to 9c33911 as it makes testing the failure call backs possible but I'm not sure if thats a direction the project wants to take the mockwebserver
in. So I have kept that as isolated commit so it can be dropped without compromising the core change.
The fact that each expectFailure
test takes 20s to complete gives me pause but to change that involves exposing configuration for the retry behaviour which seems like a bigger deal than a slow test.
junit/mockwebserver/src/main/java/io/fabric8/mockwebserver/dsl/ReturnOrWebsocketable.java
Outdated
Show resolved
Hide resolved
...mockwebserver/src/main/java/io/fabric8/mockwebserver/internal/MockServerExpectationImpl.java
Outdated
Show resolved
Hide resolved
0fab3b2
to
3881386
Compare
Some notes about the MockWebServer. For version 7.0.0 we're moving it away from OkHttp. Regarding the failure testing (I still haven't checked exactly what you're doing), but I kind of recall writing failure expectations without the need to modify the MockWebServer. I think these are the ones: As I said, I haven't checked (yet) what you're trying to accomplish, but maybe this approach could be vaild for you. |
Thanks @manusa
Hmm I'm maybe using a different definition of failure, I want the connection to fail rather than the request itself. I think the current impl is broken if you specify |
AFK |
655fdb3
to
120fbf1
Compare
@SamBarker : I might be wrong but this test failure on windows gh action job looks related to your changes.
Could you please check if this is related? |
Yeah sorry its taken a few days to organise a windows box and get it into a state to reproduce the failure. The TL;DR the exceptions propagated are completely different on windows to macos/linux. So the choices are:
I lean slightly to option 1 as that gives a better test for the other platforms but I'm open to better suggestions or other ways to test the behaviour. |
0ff66e8
to
ff287b7
Compare
I came up with a better option in ff287b7 realising I could use the Junit to detect the current platform and thus return the right exception type. I've now tested the jetty client against Openshift /CRC. So I think this is good to go. @manusa @rohanKanojia anything else you need from me before merging? |
@SamBarker : Thanks, Marc is on PTO this week. We'll try to get this merged next week. |
… clients are completely different.
…OkHttp and thus enable the test on Windows.
ff287b7
to
2a6a7ea
Compare
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you @SamBarker
Description
When fixing #6143 it was observed that the Jetty client was not handling failures well. This PR fails the appropriate futures when failures are encountered.
Type of change
test, version modification, documentation, etc.)
Checklist